<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html  xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<base href="<%=basePath%>">
<title>产品配置</title>
	<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
</style>
<script src="js/jquery.validate.js" type="text/javascript" ></script>
<script src="js/jquery.divbox.js" type="text/javascript"></script>
<script src="js/json2.js" type="text/javascript"></script>
	<script type="text/javascript">
	var startP = 1;
	var Formstatus=true;

	$(document).ready(function() {
		//初始读取数据
		loadProductData();
		loadNoCarProdTypes(); //加载“产品类型” 下拉列表
		loadInsurePeriod();//加载"保险期间" 下拉列表
	});
	
	//查询产品类型
	function loadNoCarProdTypes(){
		$.ajax({
			url : "noCarProduct/queryProdType",
			type : 'POST',
			async : true,
			dataType:'json',
			data:{parentCode:2},
			success:function(prodTypeList){
				if($.validate(prodTypeList))return;
				
				if(prodTypeList[0]!=undefined){		
					 $.each(prodTypeList,function(i,item){
						$("#eprodType").append("<option value="+item.code+">"+item.codeName+"</option>");
					 });
				}
			}
		});
	}
	//查询保险期间
	function loadInsurePeriod(){
		$.ajax({
			url : "noCarProduct/queryInsurePeriod",
			type : 'POST',
			async : true,
			dataType:'json',
			success:function(insurePeriodList){
				if($.validate(insurePeriodList))return;
				
				if(insurePeriodList[0]!=undefined){		
					 $.each(insurePeriodList,function(i,item){
						$("#PPP_UNIT").append("<option value="+item.code+">"+item.codeName+"</option>");
					 });
				}
			}
		});
	}
	function bindradio(){
		$("input[type='radio']").click(function(){
			$("input[name='radioProduct']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");

       	});
	}

	function queryProduct(displayPage){
		var prodCode= $("#prodCode").val();
		var prodName= $("#prodName").val();
		var status= $("#status").val();
		var startDate= $("#startDate").val();
		var endDate= $("#endDate").val();
		loadProductData({current:displayPage,size:10,prodCode:prodCode,prodName:prodName,status:status,startDate:startDate,endDate:endDate});
	}
	var isExportFlag=false;
	function loadProductData(param){
		   
		   var jsonDate;
		   
			if(null != param && null != param.current){
				var str = "";
				var strReg = "[0-9]{4}-[0-9]{2}-[0-9]{2}";
				var startDate = param.startDate;
				var endDate = param.endDate;
				if(null != startDate && "" != startDate){
					if(startDate.match(strReg)==null){
						$.message("error", "您输入的定义起期格式不正确，格式为:YYYY-MM-DD");
						return;
					}
				}
				if(null != endDate && "" != endDate){
					if(endDate.match(strReg)==null){
						$.message("error", "您输入的定义止期格式不正确，格式为:YYYY-MM-DD");
						return;
					}
				}
				jsonDate =param;
				
			}else{
				jsonDate={current:1,size:10};
			}
			$.openLoading();
			$.ajax({
					url : "noCarProduct/queryList",
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(page) {
						    $.closeLoading();
							if($.validate(page))return;
							startP = page.current;
							isExportFlag=page.obj;//是否导出标识符
							var fristbutton='';
							 if(isExportFlag){
								 firstbutton="<input class='input_fxk' name='radioProduct' type='radio' value='#'>@<input class='input_fxk' name='checkProduct' type='checkBox' value='#'>";	
								 $("#expProd").show();
							}else{
								 firstbutton ="<input class='input_fxk' name='radioProduct' type='radio' value='#'>";
								 $("#expProd").hide();
								 if($('#gatewayproductTable tr th:eq(1)').html()=="导出"){
									 $('#gatewayproductTable tr th:eq(1)').remove();
								 }
							}  
							//var firstbutton ="<input class='input_fxk' name='radioProduct' type='radio' value='#'>";
							var lastbutton = "<a href='javascript:void(0)' onClick='editTradProd(this);return false'>编辑</a>&nbsp;<a href='javascript:void(0)' onClick='delTradProdInst(this);return false'>删除</a>";
							var tableContent = creatTable1("prodType@TDH,prodTypeDscp,prodCode,prodName,prodDesc@TDH,insertTime,isPool@TDH,status?[{0:'无效'};{1:'有效'}],maxDelayDay@TDH,maxDays@TDH,minDays@TDH,agentType@TDH,conInsuCode@TDH,pppUnit@TDH,longestCancelDay@TDH,minDelayDay@TDH,minDelayUnit@TDH,tgtType@TDH",page,firstbutton,lastbutton);
							var tableObj = $("#gatewayproductTable");
							tableObj.find("tbody").remove();
							tableObj.append(tableContent);
							var strPage = creatChannelPage(startP,6,page.maxPage,"7");
							var pageDIV = $("#txproductpageDIV");
							pageDIV[0].innerHTML="";
							pageDIV.append(strPage);
							bindradio();
					}
				});
		}
	function delTradProdInst(obj){
		$.dialog({
			type: "warn",//success,error
			content: "您确定要删除该产品吗？",
			onOk: function() {
				prodCodeFlag=3;
				if(isExportFlag){
					prodCodeFlag=4;
				}
				 var prodCode = $(obj).parent('td').parent('tr')[0].childNodes[prodCodeFlag].innerHTML;
				// alert(prodCode);
				deleteTradProdInst(prodCode);
			}
		});
	}
	function deleteTradProdInst(prodCode){
		$.openLoading();
		$.ajax({
			url : "noCarProduct/delNocarProd",
			type : 'POST',
			async : true,
			dataType:'json',
			data:{
				prodCode:prodCode
			},
			success : function(obj) {
				$.closeLoading();
				if($.validate(obj))return;
				queryProduct(1);
			}
		});
	}
	var prodCode="";
	var prodType="";
	var originalIsPools = "";
	function editTradProd(obj){
 		var editTr = $(obj).parent('td').parent('tr')[0];
 		prodTypeFlag=1;
 		prodCodeFlag=3;
 		prodNameFlag=4;
 		prodDescFlag=5;
 		isPoolFlag=7;
 		statusFlag=8;
 		maxDelayDayFlag=9;
 		maxDaysFlag=10;
 		minDaysFlag=11;
 		agentTypeFlag=12;
 		conInsuCodeFlag=13;
 		pppUnitFlag=14;
 		minDelayDayFlag=16;
 		longestCancelDayFlag=15;
 		minDelayUnitFlag = 17;
 		tgtTypeFlag = 18;
	if(isExportFlag){
		prodTypeFlag=2;
		prodCodeFlag=4;
		prodNameFlag=5;
 		prodDescFlag=6;
 		isPoolFlag=8;
 		statusFlag=9;
 		maxDelayDayFlag=10;
 		maxDaysFlag=11;
 		minDaysFlag=12;
 		agentTypeFlag=13;
 		conInsuCodeFlag=14;
 		pppUnitFlag=15;
 		minDelayDayFlag=17;
 		longestCancelDayFlag=16;
 		minDelayUnitFlag = 18;
 		tgtTypeFlag = 19;
		}
 		prodType = editTr.childNodes[prodTypeFlag].innerHTML;
 		prodCode = editTr.childNodes[prodCodeFlag].innerHTML;
 		var prodName = editTr.childNodes[prodNameFlag].innerHTML;
 		var prodDesc = editTr.childNodes[prodDescFlag].innerHTML;
 		var isPool = editTr.childNodes[isPoolFlag].innerHTML;
 		originalIsPools = isPool;
 		var status = editTr.childNodes[statusFlag].innerHTML;
 		var maxDelayDay = editTr.childNodes[maxDelayDayFlag].innerHTML;
 		var maxDays = editTr.childNodes[maxDaysFlag].innerHTML;
 		var minDays = editTr.childNodes[minDaysFlag].innerHTML;
 	/* 	var agentType = editTr.childNodes[agentTypeFlag].innerHTML; */
 		var conInsuCode = editTr.childNodes[conInsuCodeFlag].innerHTML;
 		var pppUnit = editTr.childNodes[pppUnitFlag].innerHTML;
 		var minDelayDay =editTr.childNodes[minDelayDayFlag].innerHTML;
 		/* var longestCancelDay=editTr.childNodes[longestCancelDayFlag].innerHTML; */
 		var minDelayUnit = editTr.childNodes[minDelayUnitFlag].innerHTML;
 		var tgtType = editTr.childNodes[tgtTypeFlag].innerHTML;
		$("#eprodType").val(prodType);
		hidenOrShowTgtType();
 		$("#eprodName").val(prodName);
 		$("#eisPool").val(isPool);
 		$("#conInsuCode").val(conInsuCode);
 		hidenOrShowConInsuType();
 		$("#eprodDesc").val(prodDesc);
 		$("#minDelayDay").val(minDelayDay);
 		$("#maxDelayDay").val(maxDelayDay);
 		/* $("#longestCancelDay").val(longestCancelDay); */
 		$("#maxDays").val(maxDays);
 		$("#minDays").val(minDays);
 		$("#tgtType").val(tgtType);
 		$("#PPP_UNIT").find("option[value='"+pppUnit+"']").attr("selected",true);
 		$("#minDelayUnit").find("option[value='"+minDelayUnit+"']").attr("selected",true);
 		/* $("#agentType").val(agentType); */
		if(status=='有效')
		{
	 		$("#estatus").val('1');
		}
		if(status=='无效')
		{
	 		$("#estatus").val('0');
		}
 		$("#editProdDiv").OpenDiv();
	}

	function saveEditProd(){
		var $isPool = $("#eisPool");
		var $prodName = $("#eprodName");
		var $status = $("#estatus");
		var $prodType = $("#eprodType");
		var $maxDelayDay = $("#maxDelayDay");
		var $minDays = $("#minDays");
		var $maxDays = $("#maxDays");
		 /* var $longestCancelDay =$("#longestCancelDay"); */
		var $minDelayDay = $("#minDelayDay");
		var $tgtType = $("#tgtType");
	    if($.trim($prodName.val()).length==0){
	    	$.message("error","产品名称不能为空");
	    	$prodName.focus();
	    	return false;
	    }
	    //产品归类
	    if($prodType.val()==""){
	    	$.message("error","请选择产品归类");
	    	$prodType.focus();
	    	return false;
	    }
	  //共保选项
	    if($isPool.val()==""){
	    	$.message("error","请选择共保类型");
	    	$isPool.focus();
	    	return false;
	    }
	  //产品状态
	    if($status.val()==""){
	    	$.message("error","请选择产品状态");
	    	$status.focus();
	    	return false;
	    }
	    //最长延时起保时间：不小于0的整数，且首位非0
	    if($.trim($maxDelayDay.val()).length==0){
	    	/* $.message("error","请输入最长延时起保时间");
	    	$maxDelayDay.focus();
	    	return false; */
	    }else{
	    	var maxDelayDayReg = new RegExp("^(0|[1-9][0-9]*)$");
			var delayflag = maxDelayDayReg.test($maxDelayDay.val());
			if(!delayflag){
				$.message("error","最长延时起保时间必须是不小于0的整数");
				$maxDelayDay.focus();
				return false;
			}
			if(parseInt($minDelayDay.val())>parseInt($maxDelayDay.val())){
				$.message("error","最长延时起保时间不能小于最短延时起保时间");
				$maxDelayDay.focus();
				return false;
			}
		}
	  	//最短保险天数：大于等于1的正整数
	    if($.trim($minDays.val()).length==0){
	    	/* $.message("error","请输入最短保险天数");
	    	$minDays.focus();
	    	return false; */
	    }else{
			var minDayReg = new RegExp("^[1-9][0-9]*$");
			var minDayflag = minDayReg.test($minDays.val());
			if(!minDayflag){
				$.message("error","最小保险期间必须是不小于1的整数");
				$minDays.focus();
				return false;
			}
		}
	  	//最长注销天数:只能填入大于等于0的整数，默认为0.
	   /*  if($.trim($longestCancelDay.val()).length=0){
	    	$.message("error","请输入最长注销天数");
	    	$longestCancelDay.focus();
	    	return false;
	    }else{
	    	//alert($longestCancelDay.val());
	    	var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*)$");
	        var delayflag = minDelayDayReg.test($longestCancelDay.val());
	        if(!delayflag){
	        	$.message("error","最长注销天数必须是不小于0的整数")
	        	$longestCancelDay.focus();
	        	return false;
	        }
	    } */

	 	//最短延时起保时间：不小于0的整数，且首位非0
	    if($.trim($minDelayDay.val()).length==0){
	    	$.message("error","请输入最短延时起保时间");
	    	$minDelayDay.focus();
	    	return false;
	    }else{
	    	var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*|-[1-9][0-9]*)$");
			var delayflag = minDelayDayReg.test($minDelayDay.val());
			if(!delayflag){
				$.message("error","最短延时起保时间必须是整数");
				$minDelayDay.focus();
				return false;
			}
		}
	  	
	  	
	  	//最长保险天数：大于等于1的正整数，且必须大于最短保险天数
	    if($.trim($maxDays.val()).length==0){
	    	/* $.message("error","请输入最长保险天数");
	    	$maxDays.focus();
	    	return false; */
	    }else{
			var maxDayReg = new RegExp("^[1-9][0-9]*$");
			var maxDayflag = maxDayReg.test($maxDays.val());
				if(!maxDayflag){
				if($maxDays.val()!=0){
					$.message("error","最大保险期间必须是不小于1的整数");
					$maxDays.focus();
					return false;
				}
			}
			if(parseInt($minDays.val())>parseInt($maxDays.val())){
				$.message("error","最大保险期间不能小于最小保险期间");
				$maxDays.focus();
				return false;
			}
		}
	  //销售类型校验 2015年7月18日14:08:17
    /*   var $agentType= $("#agentType");
      if($agentType.val()==""){
    	$.message("error","请选择销售类型");
    	$agentType.focus();
    	return false;
      } */
      var conInsuCode= $("#conInsuCode").val();
      if("Y" == $isPool.val()){
    	  if(""==conInsuCode){
    		  $.message("error","请选择共保方式");
    	      	return false;
    	  }
      }
      if("N"== originalIsPools && "Y" == $isPool.val() && "1" == $status.val()){
    	  $.message("error","是否共保由[否]改为[是]由于未配置共保信息，产品状态只能修改为无效");
	      return false;
      }
	  var prodName = $prodName.val();
	  var isPool = $isPool.val();
	  var status = $status.val();
	  var prodType = $prodType.val();
	  var prodDesc = $("#eprodDesc").val();
	  var maxDelayDay = $("#maxDelayDay").val();
	  var minDays = $("#minDays").val();
	  var maxDays = $("#maxDays").val();
	  var minDelayDay_val=$minDelayDay.val();
	  /* var longestCancelDay_val=$("#longestCancelDay").val(); */
	  var pppUnit_val = $("#PPP_UNIT").val();
	  var minDelayUnit = $("#minDelayUnit").val();
	  var tgtType = $("#tgtType").val();
	/*   var agentType_val= $agentType.val(); */
	  if("Y"== originalIsPools && "N" == isPool ){
		  $.dialog({
				type: "warn",
				content: "是否共保为否时，可能删除共保信息配置，您确定修改吗？",
				onOk: function() {
					updateProdInfo({prodCode:prodCode,prodName:prodName,prodType:prodType,status:status,isPool:isPool,prodDesc:prodDesc,maxDelayDay:maxDelayDay,minDays:minDays,maxDays:maxDays,/* agentType:agentType_val, */conInsuCode:conInsuCode,originalIsPools:originalIsPools,pppUnit:pppUnit_val,/* longestCancelDay:longestCancelDay_val, */minDelayDay:minDelayDay_val,minDelayUnit:minDelayUnit,tgtType:tgtType});
				}
			});
	  }else{
		  updateProdInfo({prodCode:prodCode,prodName:prodName,prodType:prodType,status:status,isPool:isPool,prodDesc:prodDesc,maxDelayDay:maxDelayDay,minDays:minDays,maxDays:maxDays,/* agentType:agentType_val, */conInsuCode:conInsuCode,originalIsPools:originalIsPools,pppUnit:pppUnit_val,/* longestCancelDay:longestCancelDay_val, */minDelayDay:minDelayDay_val,minDelayUnit:minDelayUnit,tgtType:tgtType});
	  }
	}
	
	function updateProdInfo(param){
		if(!Formstatus){
			$.message("error", "正在处理中");
			return;
		}
		Formstatus=false;
		$.openLoading();
		$.ajax({
			url : "noCarProduct/updateNocarProd",
			type : 'POST',
			async : true,
			dataType:'json',
			data:param,
			success : function(obj) {
				Formstatus=true;
				$.closeLoading();
				if($.validate(obj))return;
				//
				if("other"==obj.result){
					$("#estatus").find("option[value='0']").attr("selected",true);
					$.message("error","险别定义未完成产品只能为无效状态！请先配置险别后修改");
				}
				loadProductData();
				closeEditProdDiv();
			}
		});
	}
	
	function vreset(){
		$("#prodCode").val("");
		$("#prodName").val("");
		$("#startDate").val("");
		$("#endDate").val("");
		$("#status").val("");
		$("#minDelayDay").val("");
		$("#maxDelayDay").val("");
		$("#minDays").val("");
		$("#maxDays").val("");
		$("#minDelayDay").val("");
		/* $("#agentType").val(0); */
		$("#longestCancelDay").val("");
	}
	function add(){
		window.location.href='<%=basePath%>noCarProduct/add';
	}
	function insuranceAdd(){
		var radioProduct = $("input[name='radioProduct']:checked");//取到对象
		if(radioProduct.val()!=undefined){
			var  typeFlag = 1;
			var  prodFlag = 3;
			if(isExportFlag){
				typeFlag = 2;
				prodFlag =4;
			}
	 		var prodType = $(radioProduct).parent('td').parent('tr')[0].childNodes[typeFlag].innerHTML;
	 		var prodCode = $(radioProduct).parent('td').parent('tr')[0].childNodes[prodFlag].innerHTML;
			window.location.href='<%=basePath%>noCarProduct/prodRisk?prodType='+prodType+'&prodCode='+prodCode;
		}else{
			$.message("error", "请选择一个产品");
		}
		
		
	}
	function conInsureAdd(){
		var radioProduct = $("input[name='radioProduct']:checked");//取到对象
		if(radioProduct.val()!=undefined){
			var  typeFlag =1;
			var  codeFlag=3;
			var  poolFlag=7;
			if(isExportFlag){
				typeFlag = 2;
				codeFlag =4;
				poolFlag =8;
			}
	 		var prodType = $(radioProduct).parent('td').parent('tr')[0].childNodes[typeFlag].innerHTML;
	 		var prodCode = $(radioProduct).parent('td').parent('tr')[0].childNodes[codeFlag].innerHTML;
	 		var isPools = $(radioProduct).parent('td').parent('tr')[0].childNodes[poolFlag].innerHTML;
	 		if("N" == isPools || "" ==isPools){
	 			$.message("error", "选中产品为非共保，不支持共保信息配置");
	 			return;
	 		}
			window.location.href='<%=basePath%>noCarProduct/conInsure?prodType='+prodType+'&prodCode='+prodCode;
		}else{
			$.message("error", "请选择一个产品");
		}
		
		
	}
	
	function exportProducts(){
		var prodCode='';
		$("input[name='checkProduct']:checked").each(function(){
			if(''==prodCode){
				prodCode = $(this).parent().parent().children("td:eq(4)").html()
			}else{
				prodCode =prodCode+","+ $(this).parent().parent().children("td:eq(4)").html()
			}
		});
		if(prodCode==''){
			$.message("error", "请至少选择一个产品");
			return;
		}
		//alert(prodCode);
		window.location.href='<%=basePath%>noCarProduct/downLoadProds?prodCode='+prodCode;
	}
	
	
	function closeEditProdDiv(){
		$("#editProdDiv").CloseDiv();
		originalIsPools = "";
	}
	
	function hidenOrShowConInsuType(){
		var isPool = $("#eisPool").val();
		if("Y" == isPool){
			$(".isSupportConInsu").show();
		}else{
			$('.isSupportConInsu').hide();
			$("#conInsuCode").val("");
		}
	}

	function hidenOrShowTgtType(){
		var eprodType = $("#eprodType").val();
		if("049S" == eprodType){
			$(".tgtType").show();
		}else{
			$(".tgtType").hide();
		}
	}
	</script>
</head>
<body >
	<div class="current">
           <table class="current_table_1">
              <tbody>
                <tr class="f2">
                  <td>
                    <img src="./images/current_1.jpg">
                  </td>
                  <td class="current_table_1_td">
                    <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
                      <span style=" color:#136bab; ">财险产品管理
                      <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>产品配置
                  </span>
                  </td>
                  <td><img src="./images/current_3.jpg"></td>
              </tr>
           </tbody>
         </table>
      </div>
		
		<table class="table_02" id="table">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td width="20%" height="30">产品代码：
								<input name="txt3" id="prodCode" type="text" class="input_text" value="">
							</td>
							<td width="20%" height="30">产品名称：
								<input name="txt3" id="prodName" type="text" class="input_text" value="">
							</td>
							<td width="20%" height="30">状态：
							 	<select class="search_select_1" id="status">
									<option value="">--请选择--</option>
									<option value="1">有效</option>
									<option value="0">无效</option>
								</select>
							</td>
							<td width="20%" height="30">定义起期：
								<input id="startDate" onkeydown="false" onclick="showCalendar('startDate','y-mm-dd');" class="input_time" type="text" />
							</td>
							<td width="20%" height="30">定义止期：
								 <input id="endDate" onkeydown="false" onclick="showCalendar('endDate','y-mm-dd');" class="input_time" type="text" />
							</td>
						</tr>
						<tr height="30px">
							<td style="text-align: center;" colspan="5" width="100%" height="30">
								<input type="button" class="input_button_1" id="searchBtn" value="查询" onClick="queryProduct(1)" />&nbsp;
							    <input type="button" class="input_button_1" id="searchBtn" value="重置" onClick="vreset()" />
							</td>
						</tr> 
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td width="100%" height="30">
								<input type="button" class="input_button_1" id="searchBtn" value="新增" onClick="add()" />&nbsp;
								<input type="button" class="input_button_2" id="searchBtn" value="配置险别" onClick="insuranceAdd()"/>&nbsp;
								<input type="button" class="input_button_2" id="searchBtn" value="共保信息" onClick="conInsureAdd()"/>&nbsp;
								<input type="button" class="input_button_2" id="expProd" value="产品导出" onClick="exportProducts()"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="gatewayproductTable" class="content_table_1">
						<thead>
							<tr class="f1">
								<th style="width:5%;">选择</th>
								<th style="width:5%;">导出</th>
								<th style="width:25%;">产品归类</th>
								<th style="width:10%;">产品代码</th>
								<th style="width:25%;">产品名称</th>
								<th style="width:15%;">定义时间</th>
 								<th style="width:6%;">状态</th>
								<th style="width:14%;">操作</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="txproductpageDIV" class="page"></div>
				</td>
			</tr>
		</table>
		
		 <!--   	添加模板 DIV 默认隐藏-->
	        <div id="editProdDiv"  style="display:none;overflow-y:auto; width:60%">
			<input type="hidden" id="row_num" name="row_num" value="0"/>
			<div class="table_title_div">
					<table class="table_title" style='width:100%;height: 20px;'>
						<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="/manager/images/closedown.gif" alt="关闭"  onclick="closeEditProdDiv()"/></td>
						</tr>
					</table>
			</div>
			<!-- 修改id 名 -->
			<table class="table_02" id="addtempletTable" align="center">
				<tbody>
					<tr>
						<td>
							<table id="coverageTable"  class="content_table_1" style="height:120px;">
								
								<tbody>
									<tr>
					                  <td width="40%" style="text-align:right;border-right:0px;">产品名称：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><input type="text" id="eprodName" class="input_text" style="width: 250px"><span class="red">*</span></td>
					                </tr>
					                <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">产品归类：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><select name="eprodType" id="eprodType" class="select_1" disabled="disabled" style="visibility: visible;width: 250px;">
					                  <option value="">------------------请选择------------------</option></select></td>
					                </tr>
 					                <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">是否共保：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><select name="eprodType" id="eisPool" class="select_1" style="visibility: visible;width: 250px;" onchange="hidenOrShowConInsuType()">
 	                  				  <option value="N">否</option>
 	                  				  <option value="Y">是</option>
	                  				  </select></td>
					                </tr>
					                <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">产品状态：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><select name="eprodType" id="estatus" class="select_1" style="visibility: visible;width: 250px;">
 					                  <option value="0">无效</option>
	                  				  <option value="1">有效</option>
					                  </select></td>
					                </tr>
					                <tr>
					                  <td width="40%" style="text-align:right;border-right:0px;">最长延时起保时间：</td>
					                  <td width="60%" style="text-align:left"><input name="maxDelayDay" id="maxDelayDay" type="text" maxlength="50"  class="input_text" style="width: 250px"></td>
					                </tr>
					                <tr>
					                	<td width="40%" style="text-align:right;border-right:0px;">最短延时起保时间：</td>
						                <td width="60%" style="text-align:left"><input name="minDelayDay"  id="minDelayDay" type="text" class="input_text" maxlength="5" ><span class="red">*</span>
						                	<span>
						                		<select id="minDelayUnit">
						                			<option value="d">天</option>
						                			<option value="h">小时</option>
						                			<option value="m">分钟</option>
						                		</select>
						                	</span>
						                	<span class="blue">支持负数</span>
						                </td>
					                </tr>
					                <%--  <tr>
						              	  <td width="40%" style="text-align:right;border-right:0px;">最长起保后注销天数：</td>
						                  <td width="60%" style="text-align:left"><input name="longestCancelDay"  id="longestCancelDay" class="input_text" type="text" maxlength="5" value="0"><span class="red">*</span></td>
						              </tr> --%>
					                <tr>
					                  <td width="40%" style="text-align:right;border-right:0px;">保险期间：</td>
					                  <td  width="60%" style="text-align:left">
					                  	<input name="minDays" id="minDays" type="text" maxlength="50"  class="input_text" style="width:60px;">&nbsp;至&nbsp;
					                  	<input name="maxDays" id="maxDays" type="text" maxlength="50"  class="input_text" style="width:60px;">&nbsp;&nbsp;
					                  	<select name="PPP_UNIT" id="PPP_UNIT" class="select_1"  style="width:55px;visibility: visible;"></select>
					                  </td>
					                </tr>
					              <%--   <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">销售类型：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left">
						                  <select name="agentType" id="agentType" class="select_1" disabled="disabled" style="visibility: visible;width: 250px;">
		 					                  <option value="">--------请选择--------</option>
						                  	  <c:forEach var ="agentType" items="${agentTypeList}">
					                  			 <option value="${agentType.code}">${agentType.codeName}</option>
					                  		  </c:forEach>
						                  </select><span class="red">*</span>
					                  </td>
					                </tr> --%>
					                <tr class = "isSupportConInsu">
									    <td width='40%' style='text-align:right;border-right:0px;'>共保方式：&nbsp;&nbsp;</td>
									    <td width='60%' style='text-align:left'>
									        <select name='conInsuCode' id='conInsuCode' class='select_1' style='visibility: visible;width: 250px;'>
									            <option value=''>--------请选择--------</option>
									            <option value='01'>共出</option>
									            <option value='02'>共入</option>
									        </select><span class='red'>*</span>
									    </td>
									</tr>
									<tr style="display: none" class="tgtType">  
					                  <td width="40%" style="text-align:right;border-right:0px;">清单类型：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left">
						                  <select name="tgtType" id="tgtType" class="select_1" style="visibility: visible;width: 250px;" >
		 					                  <option value="">--------请选择--------</option>
						                  	  <c:forEach var ="tgtType" items="${tgtTypeList}">
					                  			 <option value="${tgtType.code}">${tgtType.codeName}</option>
					                  		  </c:forEach>
						                  </select>
					                  </td>
					                </tr>
					                <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">交易系统产品描述：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><textarea id="eprodDesc"  maxlength="50"  rows="5" class="textarea_1" style="resize:none;width: 250px"></textarea></td>
					                </tr>
								</tbody>
							</table>
							
						</td>
					</tr>
				</tbody>
			</table>
			<div align="center">
			   <input class="input_button_3" name="" type="button" onclick="saveEditProd()" value="保存">&nbsp;&nbsp;
	           <input class="input_button_3" name="" type="button" onclick="closeEditProdDiv()" value="取消">
			</div>
	</div>
		
		<div id="Loading" style="display:none" align="center">
			<img src="./images/loading.gif" />
		</div>
		
		<div id="detail" style="display: none;">
			<div id="input" style="margin: 5px;h word-wrap: break-word"></div>
		</div>
		<div id="detail2" style="display: none;">
			<h4 style="background-color: #A4BDE3;"></h4>
			<table>
				<thead></thead>
				<tr>
					<td width="200px"></td>
					<td align="right"><img src="./images/closedown.gif"
						onclick="closeDiv()" /></td>
				</tr>
			</table>

			<div id="output" style="margin: 5px; word-wrap: break-word"></div>
		</div>
</body>
</html>